<?php

namespace App\Admin\SDK\IBay;

// ibay SDK by Martin
class Sku extends Core{


    # 使用方法
    #  $sdk = new Sku();
    #  if ($sdk->getSkus())
    #  {
    #     $res = $sdk->response();
    #  }

    /**
     * Getskus 获取产品列表
     *
     * @param $page
     * @param $perpage
     * @param $sku
     * @url  /GetSKUs/perpage/".$page_size."/page/".$page."/sku/".$sku
     *
     */
    public function getSkus($perpage=30, $page=1, $sku=null):bool
    {
        $url =  $this->url.'/GetSKUs';
        $url .=  '/auth/'.config("ibay.api")['code'];
        $url .=  '/perpage/'.$perpage.'/page/'.$page;
        $sku && $url .= '/sku/'.$sku;

        return $this->request($url);

    }


}